package xxy.com.yangproject

import android.app.Application
import android.content.Context
import android.util.DisplayMetrics
import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.ToastUtils
import xxy.com.yangproject.global.Constant

class TestKotlin(param1: String, param2: String){

    object invoke{
        private lateinit var s1 : String

        fun invokeSomthing(){
            if (!::s1.isInitialized) {
                LogUtils.eTag(Constant.TAG, "s1.isInitialized")
                s1 = "2"
                LogUtils.eTag(Constant.TAG, "赋值s1：$s1")
            }
        }

    }

    class App : Application(){
        companion object{
            var _context: Application? = null
            fun getContext(): Context {
                return _context!!
            }
        }

        override fun onCreate() {
            super.onCreate()
            _context = this;
        }
    }

    fun e(ee : Float){
        val compareTo = ee.compareTo(2);
        ToastUtils.showShort("haha")
        /**DP * (dpi/160)
         *dor per inch
         *360 720
         * x    dpi
         * dp   160
         * width-qualifier
         * values-qualifier
         *
        */
        val displayMetrics = DisplayMetrics();
    }
}